package com.baizhi.controller;

import com.baizhi.entrty.Menu;
import com.baizhi.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequestMapping("category")
    @ResponseBody
    public Map category(){
        Map map = new HashMap();
        List<Menu> lists = menuService.category();
        System.out.println(lists);
        map.put("isMenu",lists);
        return map;
    }
}
